package com.example.yunJie.digitalSentry.control;

import com.example.yunJie.digitalSentry.entity.ApproveEntity;
import com.example.yunJie.digitalSentry.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/Approve")
public class ApproveControl {

    @Autowired
    private ApproveService approveService;

    @RequestMapping("/add")
    public void insert(ApproveEntity approveEntity) {
        approveService.insert(approveEntity);
    }

    @RequestMapping("/update")
    public int update(ApproveEntity approveEntity) {
        return approveService.update(approveEntity);
    }

    @RequestMapping("/deleteById")
    public int deleteById(String id) {
        return approveService.deleteById(id);
    }

    @RequestMapping("/deleteIdList")
    public int deleteIdList(List<Integer> id) {
        return approveService.deleteIdList(id);
    }

    @RequestMapping("/findId")
    public ApproveEntity findId(String id) {
        return approveService.findId(id);
    }

    @RequestMapping("/findAll")
    public List<ApproveEntity> findAll(ApproveEntity approveEntity) {
        return approveService.findAll(approveEntity);
    }

}
